<script setup lang="ts">
import { defineAsyncComponent, onMounted, ref } from "vue";
import { useUrlSearchParams } from "@vueuse/core";

const componentActive: any = ref();
onMounted(() => {
  const params = useUrlSearchParams("history"); //history模式
  if (params.id) {
    const demo = defineAsyncComponent(
      () => import(`@/views/dataV/demonstration/${params.id}/index.vue`)
    );
    componentActive.value = demo;
  }
});
</script>
<template>
  <component :is="componentActive" />
</template>
<style scoped lang="less"></style>
